package com.qfedu.micrograss.grass.task;

import com.qfedu.micrograss.grass.service.GrassService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class GrassTask {


    @Resource
    private GrassService grassService;

    //@Scheduled(cron = "0/10 * * * * ?")
    public void updateLikeNumTask() {

        grassService.updateGrassLikeNumTask();


    }
    @XxlJob("updateLikeNumTask")
    public void xxljobupdateLikeNumTask() {
        System.out.println("xxl job 执行");
        grassService.updateGrassLikeNumTask();


    }
    @XxlJob("updateGrassEnableHandler")
    public void xxljobupdateEnablestate() {
        System.out.println("更新笔记的可见状态");

        String jobParam = XxlJobHelper.getJobParam();
        System.out.println("需要更新装的笔记id"+jobParam);


    }
}
